﻿using Clinic.IService;
using Clinic.Model.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Clinic.Service
{
    public class UserService : IUserService
    {
        public Task<List<PermissionDto>> GetPermissionAsync(Guid userId)
        {
            List<PermissionDto> permissionDtos = new List<PermissionDto>();
            PermissionDto sysTemConfig = new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 1, MenuName = "系统设置" };
            permissionDtos.Add(sysTemConfig);
            permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 1, MenuName = "菜单管理", ViewName = "MenuManagerView", Power = 7, ParentMenuId = sysTemConfig.MenuId });
            permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 2, MenuName = "角色管理", ViewName = "RoleView", Power = 7, ParentMenuId = sysTemConfig.MenuId });
            permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 2, MenuName = "用户管理", ViewName = "UserView", Power = 7, ParentMenuId = sysTemConfig.MenuId });
            //permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 3, MenuName = "诊所管理", Power = 7, ParentMenuId = sysTemConfig.MenuId });

            PermissionDto sysTemConfig2 = new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 1, MenuName = "系统设置" };
            permissionDtos.Add(sysTemConfig2);
            permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 1, MenuName = "菜单管理", ViewName = "MenuManagerView", Power = 7, ParentMenuId = sysTemConfig2.MenuId });
            permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 2, MenuName = "角色管理", ViewName = "RoleView", Power = 7, ParentMenuId = sysTemConfig2.MenuId });
            permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 2, MenuName = "用户管理", ViewName = "UserView", Power = 7, ParentMenuId = sysTemConfig2.MenuId });

            //PermissionDto medicineConfig = new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 2, MenuName = "药品管理" };
            //permissionDtos.Add(medicineConfig);
            //permissionDtos.Add(new PermissionDto() { MenuId = Guid.NewGuid(), Sort = 1, MenuName = "药品录入", Power = 7, ParentMenuId = medicineConfig.MenuId });

            return Task.FromResult(permissionDtos);
        }
    }
}
